#ifndef __GRID_SAMPLE_H__
#define __GRID_SAMPLE_H__

#include <stdio.h>
#include <string>

#include "amba_net.h"
#include "common/data_type.h"

class GridSample : public AmbaNet {
 public:
  enum InputType : std::uint8_t {
    ALIGN_MATRIX = 0,
    PRE_INPUT = 1,
    Count = 2
  };

  GridSample() noexcept;
  ~GridSample();

  GridSample(GridSample const &) = delete;
  GridSample(GridSample const &&) = delete;
  GridSample &operator=(GridSample const &) = delete;
  GridSample &operator=(GridSample const &&) = delete;

  bool SetInput(std::string const &path, InputType input_type) noexcept;
  bool SetInput(char *input_buffer, std::uint32_t buffer_size,
                InputType input_type) noexcept;
  uint32_t Run(DataBuf& data_frame) noexcept;
  void test();
  static constexpr std::uint32_t kGridSampleResSize{256 * 128 * 128 * 2};
 private:
  std::uint32_t free_all_buffer();
  // memory blocks
  flexidag_memblk_t inputblk_[InputType::Count];
};

#endif